<template>
	<view>
		<u-cell-group>
			<u-cell-item title="收货地址" @click="$goto('/pages/address/list')"></u-cell-item>
			<!-- <u-cell-item title="推送设置"></u-cell-item> -->
			<u-cell-item title="清除缓存" @click="clear"></u-cell-item>
		</u-cell-group>
		
		<u-cell-group class="margin-tb-xs">
			<u-cell-item title="关于企大咖" :value="version" @click="$goto('/pages/other/about')"></u-cell-item>
		</u-cell-group>
		
		<view class="bg-white padding flex-row justify-center align-center" @click="logout">
			退出登录
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				version: '',
				name: ''
			};
		},
		onLoad() {
			this.getVer();
		},
		methods: {
			getVer() {
				// #ifdef APP-PLUS
				plus.runtime.getProperty(plus.runtime.appid, info => {
					this.version = info.version
					this.name = info.name
				})
				// #endif
			},
			logout() {
				uni.showModal({
					title: '提示',
					content: '确定要退出登录吗？',
					success: res => {
						if (res.confirm) {
							this.$store.commit('userLogout');
							this.$goto('/pages/mine/index', 'tab')
						} else if (res.cancel) {
							console.log('用户点击取消');
						}
					}
				})
			},
			clear() {
				uni.showLoading({
					title: '请稍等...',
					mask: true
				})
				setTimeout(() => {
					this.$msg('清理完成')
				}, Math.floor(Math.random() * (3000 - 1000) ) + 1000)
			}
		}
	}
</script>

<style lang="scss">

</style>
